<?php
Class Player_Model_Ability extends Core_Model_Ability
{
	protected $_score	= 10;

	protected $_mod		= 0;
	
	protected $_tScore	= 10;
	
	protected $_tMod	= 0;
	
	public function __construct($type, $score, $tScore = null)
	{
		$this->setType($type);
		$this->setScore($score);
		
		if (is_null($tScore))
		{
			$this->setTempScore($tScore);
		}
	}	
	
	public function setScore($score)
	{	
		$this->_mod		= $this->calcMod((int) $score);
		$this->_score	= (int) $score;
		$this->setTempScore($score);
	}
	
	public function setTempScore($score)
	{
		$this->_tMod	= $this->calcMod((int) $score);
		$this->_tScore	= (int) $score;
	}
	
	public function getScore($force = false)
	{
		if ($force)
		{
			return $this->_score;
		}
		
		return $this->getTempScore();
	}
	
	public function getTempScore()
	{
		return $this->_tScore;
	}
	
	public function getMod($force = false)
	{
		if ($force)
		{
			return $this->_mod;
		}
		
		return $this->getTempMod();
	}
	
	public function getTempMod()
	{
		return $this->_tMod;
	}
	
	public function getShortName()
	{
		return ucfirst($this->_type);
	}
	
	public function getLongName()
	{
		$all	= $this->getAbilities();
		return $all[$this->_type];
	}
}  